#region head comment
/*
Code generate by YhdSdkTool.
email:starpeng@vip.qq.com
2013-01-21 23:00:57:990 +08:00
*/
#endregion

using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using YhdSdk.Domain;
using YhdSdk.Domain.User;
using YhdSdk.Response.User;

namespace YhdSdk.Request.User
{
    /// <summary>
    /// 用户登录认证
    ///<para></para>
    ///<para>根据siteId和sessionId判断用户是否是1号店授权用户、登录是否过期。查询成功返回用户昵称和过期时间；</para>
    ///<para>查询失败返回错误信息。</para>
    /// </summary>
    public class YhdUserAuthGetRequest : IYhdRequest<YhdUserAuthGetResponse>
    {
        /// <summary>
        /// 网站指定Id(10:爱彩网)
        /// </summary>
        /// <example>10</example>
        [XmlElement("siteId")]
        public Int32 SiteId
        {
            get;
            set;
        }

        /// <summary>
        /// Md5字串，由siteId+code+sessionId加密而成，code是为网站分配的密钥
        /// </summary>
        /// <example>d54eb006fe1d55983aa24700ef9c53a7</example>
        [XmlElement("md5key")]
        public String Md5key
        {
            get;
            set;
        }

        /// <summary>
        /// 1号商城彩票用户的唯一标识
        /// </summary>
        /// <example>565b29c7408da8ef62d100a569e0df21</example>
        [XmlElement("sessionId")]
        public String SessionId
        {
            get;
            set;
        }

        /// <summary>
        /// Api接口名称
        /// </summary>
        public String ApiName
        {
            get{ return "yhd.user.auth.get"; }
        }

        /// <summary>
        /// 获取参数列表
        /// </summary>
        public IDictionary<string, string> GetParameters()
        {
            YhdDictionary parameters = new YhdDictionary();
            parameters.Add("siteId" ,this.SiteId);
            parameters.Add("md5key" ,this.Md5key);
            parameters.Add("sessionId" ,this.SessionId);
            return parameters;
        }

        /// <summary>
        /// 验证参数
        /// </summary>
        public void Validate()
        {
            RequestValidator.ValidateRequired("siteId", this.SiteId);
            RequestValidator.ValidateRequired("md5key", this.Md5key);
            RequestValidator.ValidateRequired("sessionId", this.SessionId);
        }

    }
}
